﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ManageMatches.aspx.cs" Inherits="TsWeb.Matches.ManageMatches" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="../Styles/datepicker.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery-1.9.1.js" type="text/javascript"></script>
    <script type="text/javascript">

        $(function () {

            $('#dp3').datepicker();
            $('#dp4').datepicker();



            var currentTime = new Date()
            var month = currentTime.getMonth() + 1
            var day = currentTime.getDate()
            var year = currentTime.getFullYear()
            var date = day + "-" + month + "-" + year


            //$('#dp3').datepicker('setStartDate', date);
            //$('#dp4').datepicker('setStartDate', date);



        });
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="LeftContent" runat="server">
    <div>
        <ul>
            <div class="accordion" id="accordion2">
                <div class="accordion-group">
                    <div class="accordion-heading">
                        <li class="nav-header" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
                            Nuevo encuentro manual</li>
                    </div>
                    <div id="collapseOne" class="collapse in">
                        <div class="accordion-inner">
                            <h6>
                                Selecione la fecha del encuentro</h6>
                            <div class="input-append date" id="dp3" data-date="12-04-2013" data-date-format="dd/mm/yyyy">
                                <asp:TextBox ID="dateText" runat="server" CssClass="inline"></asp:TextBox>
                                <span class="add-on"><i class="icon-calendar"></i></span>
                            </div>
                            <h6>
                                Seleccione el deporte</h6>
                            <asp:DropDownList ID="ComboBoxSport" runat="server" DataTextField="Name" AutoPostBack="true"
                                DataValueField="SportId" OnSelectedIndexChanged="ComboBoxSport_SelectedIndexChanged">
                            </asp:DropDownList>
                            <h6>
                                Seleccione el locatario</h6>
                            <asp:DropDownList ID="DDL1_teamHome" runat="server" DataTextField="Name" DataValueField="TeamId">
                            </asp:DropDownList>
                            <h6>
                                Seleccione el visitante</h6>
                            <asp:DropDownList ID="DDL2_teamVisitor" runat="server" DataTextField="Name" DataValueField="TeamId">
                            </asp:DropDownList>
                            <br />
                            <asp:Button ID="ButtonCreateMatch" runat="server" Text="Crear" OnClick="ButtonCreateMatch_Click"
                                CssClass="btn-success right" />
                        </div>
                    </div>
                    <div class="accordion-group">
                        <div class="accordion-heading">
                            <li class="nav-header" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
                                Generador de encuentros automáticos</li>
                        </div>
                        <div id="collapseTwo" class="collapse in">
                            <div class="accordion-inner">
                                <h6>
                                    Selecione la fecha incial</h6>
                                <div class="input-append date" id="dp4" data-date="12-04-2013" data-date-format="dd/mm/yyyy">
                                    <asp:TextBox ID="FixTextDate" runat="server"></asp:TextBox>
                                    <span class="add-on"><i class="icon-calendar"></i></span>
                                </div>
                                  <h6>
                                Seleccione el deporte</h6>
                            <asp:DropDownList ID="ComboBoxFixtureSport" runat="server" DataTextField="Name" AutoPostBack="true"
                                DataValueField="SportId" >
                            </asp:DropDownList>


                                <h6>
                                    Seleccione un generador</h6>
                                <asp:DropDownList ID="DropDownFixtureGenerators" runat="server" DataTextField="Name"
                                    AutoPostBack="true" DataValueField="FixtureId" OnSelectedIndexChanged="DropDownFixtureGenerators_SelectedIndexChanged">
                                </asp:DropDownList>
                                <br />
                                <div class = "text-left">
                               <asp:Label ID="FixtureDesc" runat="server" CssClass="help-block"></asp:Label>
                               </div>
                                <asp:Button ID="ButtonCreateAutoMatch" runat="server" Text="Generar" CssClass="btn-success right"  OnClick="ButtonCreateAutoMatch_Click"/>
                            </div>
                        </div>
                    </div>
        </ul>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Path="~/Scripts/jquery-1.9.1.js" />
            <asp:ScriptReference Path="~/Scripts/bootstrap.min.js" />
            <asp:ScriptReference Path="~/Scripts/bootstrap-datepicker.js" />
        </Scripts>
    </asp:ScriptManager>
    <p>
    </p>
    <h4>
        Todos los encuentros</h4>
    <p>
    </p>
   
    <asp:GridView ID="MatchesGrid" runat="server" AutoGenerateColumns="False" OnRowCommand="MatchesGrid_RowCommand"
        CssClass="table table-hover table-striped" GridLines="None" 
        onrowdatabound="MatchesGrid_RowDataBound">
        <Columns>
            <asp:BoundField DataField="MatchId" HeaderText="MatchId" ControlStyle-CssClass="hidden" HeaderStyle-CssClass="hidden"
                        ItemStyle-CssClass="hidden" />
            <asp:BoundField DataField="Date" HeaderText="DateTime" />
            <asp:TemplateField HeaderText="HomeTeam">
                <ItemTemplate>
                    <asp:Label ID="LabelHomeTeam" runat="server" Text='<%# Bind("HomeTeam.Name") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="VisitorTeam">
                <ItemTemplate>
                    <asp:Label ID="LabelVisitorTeam" runat="server" Text='<%# Bind("VisitorTeam.Name") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="Winner" HeaderText="Ganador" />
            
            <asp:ButtonField ButtonType="Link" CommandName="EditCommand" Text="Editar" />
            <asp:ButtonField ButtonType="Link" CommandName="DeleteCommand" Text="Eliminar" />
        </Columns>
    </asp:GridView>
</asp:Content>
